Skip to content

Derive override_current max from device current_max - #43

Closed
jeroentrappers wants to merge 1 commit into
dingo35:mainfrom
jeroentrappers:fix/override-current-max-from-device
Closed

jeroentrappers wants to merge 1 commit into
dingo35:mainfrom
jeroentrappers:fix/override-current-max-from-device

Conversation

@jeroentrappers

Copy link
Copy Markdown

Problem

number.smartevse_*_override_current is hardcoded to native_max_value=16 in const.py. On a SmartEVSE configured for a higher charge current (e.g. 32 A via the CIRCUIT setting), the override current cannot be set above 16 A from Home Assistant — and nothing on the device side, an integration reload, a HA restart, or removing/re-adding the integration changes it, because the cap lives in the static entity description.

Fix

Make native_max_value for the smartevse_override_current number follow the device's own reported settings.current_max, which is already polled every cycle in _async_update_data (self._data["smartevse_current_max"]). Falls back to the static description value when the device max is unavailable. Other number entities are unaffected.

Result

A 32 A-configured controller can now be driven up to 32 A from HA; a 16 A unit still maxes at 16 A. No user configuration required — the bound tracks the device.

The override current number was hardcoded to native_max_value=16, so a
SmartEVSE configured for a higher charge current (e.g. 32 A) could not be
driven above 16 A from Home Assistant — no device setting, reload, restart
or re-pair could lift it.

Make native_max_value for smartevse_override_current follow the device's
reported settings.current_max (already polled every cycle), falling back
to the static description value when unavailable.
@dingo35

dingo35 commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Code looks good, but I cannot test this currently; if we approve this PR it will be presented to all HACS users of this (deprecated!) integration.

Can I trust you tested this thoroughly, looking at the HA logs for errors and warnings?

@jeroentrappers

Copy link
Copy Markdown
Author

I had tested it, but in the meantime i've moved to using mqtt instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants